1. Field of the Invention
The present invention relates to a moving image encoding apparatus, a control method thereof and a computer-readable storage medium, and in particular to the technology of motion vector search.
2. Description of the Related Art
Conventionally, for example, a digital video camera is well known as a camera-integrated moving image recording apparatus that shoots a subject, and records thus obtained moving images after compressing them. In recent years, recording media have shifted from conventional magnetic tape to disk media, semiconductor memories, and the like because of their high convenience such as allowing random access. As a compression scheme, MPEG-2 is generally used, which enables compression with a high compression rate using inter-frame motion prediction, and furthermore in recent years, H.264 and other schemes are used, which enable compression with a still higher compression rate.
An encoding apparatus that employs such a compression scheme needs to search for inter-frame motion vectors in each of the macro blocks serving as the base units to be encoded, into which a frame image has been divided. Generally, motion vector search is realized by pattern matching, and it is well known that a large number of computations are necessary therefor. Accordingly, a method is often adopted in which a search area is narrowed down and set, and then a motion vector is searched for in that search area.
In view of this, a technique as disclosed in Japanese Patent Laid-Open No. 11-298904 has been proposed in order to effectually obtain a motion vector in a larger area while reducing the number of computations. In Japanese Patent Laid-Open No. 11-298904, first, a coarse search for motion vectors is performed using reduced images, and then a detailed search is performed around the motion vectors obtained through the coarse search, using the original images that have not been reduced.
Further, Japanese Patent Laid-Open No. 2005-354528 has proposed a method for determining a motion vector search area in accordance with a global vector indicating the motion of the entire frame and the reliability of this global vector.